package com.inxedu.os.edu.service.statistics.impl;


import com.inxedu.os.edu.dao.EduCourseMapper;
import com.inxedu.os.edu.pojo.EduCourse;
import com.inxedu.os.edu.pojo.EduCourseExample;
import com.inxedu.os.edu.service.statistics.CourseStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseStatisticsServiceImpl implements CourseStatisticsService {
    @Autowired
    private EduCourseMapper eduCourseMapper;
    @Override
    public List<EduCourse> selectCourseCount(Integer status) {
        EduCourseExample example = new EduCourseExample();
        EduCourseExample.Criteria criteria = example.createCriteria();
        criteria.andIsAvaliableEqualTo(status);
        List<EduCourse> eduCourses = eduCourseMapper.selectByExample(example);
        return eduCourses;
    }
}
